package com.globallogic.javatrainings.sergiiivanov.view;

import com.globallogic.javatrainings.sergiiivanov.resources.Messages;

public class BuildingsManagementPage extends GUI {

    public void addRoomWizard() {
        show("Ading new room");
        show(" enter name of new room");
    }

    public void pageAddNewBuilding() {
        newPage();
        show("Adding new Building");
        show("Enter name for new building");
    }

    public void pageBuildingGeneralDetails(String title,
            String buildingName, String[] rooms) {
        newPage();
        show(title + " > Buildings > " + buildingName);
        showLineOfList(Messages.MENU_BACK, 0);
        show("select room for more options");
        showArrayAsList(rooms, 1);
        showLineOfList("Add new room", 1 + rooms.length);
        showLineOfList("Rename building", 2 + rooms.length);
        showLineOfList("Delete this building(!!!)", 3 + rooms.length);
    }

    public void pageBuildingsList(String title, String[] buildings) {
        newPage();
        show(title + " > Buildings");
        showLineOfList(Messages.MENU_BACK, 0);
        show("Select building for more details");
        showArrayAsList(buildings, 1);
        showLineOfList("Add new building...", 1 + buildings.length);
    }

    public void pageConfirmDeletion(String buildingName) {
        show("You are about to delete building " + buildingName);
        show(" This oreration could not be un-done "
                + "\n all information about this building will be lost:"
                + "\n rooms, personnel assignments, schedule"
                + "\nAre you sure to delete this building?(Y/N)");
    }

    public void pageDeleteRoomConfirmation() {
        show("You are about to remove room");
        show("  All references will be lost:");
        show("  assignments, schedule");
        show("Are you sure to remove the room?(Y/N)");
    }

    public void pageRenameBuilding(String oldName) {
        show("Renaming building " + oldName);
        show("Enter new name (space to cancel)");
    }

    public void pageRoomSetup(String title, String buildingName, String roomName) {
        show("Setting up a room " + roomName + " in " + buildingName + " of " + title);
    }

    public void pageRoomSetup_newCapacity() {
        show(" Enter new room capacity (enter value<0 for no changes)");
    }

    public void pageRoomSetup_newId() {
        show(" Enter new room name (type spaces for no changes) ");
    }

    public void pageRoomSetup_newType(String[] namesList) {
        show(" Select new room type (enter any wrong value for no changes)");
        showArrayAsList(namesList);
    }

    public void pageSelectPersonToAssign(String[] personnelList) {
        show("Select personnel to assign");
        showArrayAsList(personnelList);
    }

    public void pageShowRoomDetails(String universityTitle,
            String buildingTitle, String[] roomDetails) {
        newPage();
        show(universityTitle + " > " + buildingTitle + " > " + roomDetails[0]);
        show("  type: " + roomDetails[1]);
        show("  capacity: " + roomDetails[2]);
        show("  responcible: " + roomDetails[3]);
        showLineOfList(Messages.MENU_BACK, 0);
        showLineOfList("Setup Room", 1);
        showLineOfList("Appointed lectures", 2);
        showLineOfList("Delete Room", 3);
    }

    public void appointedLecturesList(String buildingName, String roomName, String[][] lecturesTable) {
        show(buildingName + " > " + roomName + " > Appointed Lectures");
        showTableOrdered(lecturesTable);
        showLineOfList(Messages.MENU_BACK, 0);
    }

}
